// Requires Feature Level 9.3 or higher due to its use of two render targets.
#include "LightPrePassInclude.hlsli"

PrePassOutputPS main(PNTBTInputPS input)
{
	PrePassOutputPS output = (PrePassOutputPS)0;
	output.position  = float4(input.positionWorld, 1.0f);

	float3x3 tangentFrameWorld = float3x3(
		normalize(input.tangentWorld),
		normalize(input.bitangentWorld),
		normalize(input.normalWorld)
		);

	output.normal = float4(
		mul(normalize((normalMap.Sample(linearSampler, input.texCoord).xyz * 2.0f) - 1.0f), tangentFrameWorld),
		specularPower
		);

	return output;
}
